package kr.saeildamil.androidStudy_second.brservice;

import android.app.Service;
import android.content.Intent;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.os.Messenger;
import android.widget.Toast;

public class MessengerService extends Service {
	static final int MSG_SAY_HELLO = 1;

	@Override
	public IBinder onBind(Intent intent) {
		return messenger.getBinder();
	}

	Messenger messenger = new Messenger(new Handler() {
		public void handleMessage(Message msg) {
			switch (msg.what) {
			case MSG_SAY_HELLO:
				Toast.makeText(getApplicationContext(), "버튼누르지마라",
						Toast.LENGTH_SHORT).show();
			default:
				super.handleMessage(msg);
			}
		}
	});

}
